<?php

/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\bootstrap\ActiveForm;
use yii\widgets\LinkPager;
$this->title = '课程列表';

?>

<div class="zy_main">
	<div class="container">

        <div class="zy_top_nav font14"><a href="http://www.bwphp.com/">首页</a>  &gt;  全部课程</div>
        <div class="zy_course">
        	<ul>
      <?php if($type){?>
        <li class="zmm1">
        <div class="d1 color99">课程分类:</div>
        <div class="d2"><div>
            <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('type'=>0)]); ?>"
            <?php if($keyword['type']=='0' || empty($keyword['type'])){
                            echo "class='aH'";
                            } ?>
                            >全部</a>
            <?php foreach($type as $k=>$v){?>

                <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('type'=>$v['type_id'])])?>"
                <?php if($keyword['type']==$v['type_id']){
                            echo "class='aH'";
                            } ?>>
                    <?= Html::encode($v->type_name) ?>
                    </a>
                <?php }?>
        <?php }?>
        </div></div>
        </li>

        <?php if($source){?>
        <li class="zmm2">
        <div class="d1 color99">课程来源:</div>
        <div class="d2"><div>
            <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('source'=>0)]); ?>"
            <?php if($keyword['source']=='0'|| empty($keyword['source'])){
                                        echo "class='aH'";
                                        } ?>
                                        >全部</a>
            <?php foreach($source as $k=>$v){?>
                <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('source'=>$v['source_id'])])?>"
                <?php if($keyword['source']==$v['source_id']){
                            echo "class='aH'";
                            } ?>>
                <?= Html::encode($v->source_name) ?>
                </a>

            <?php }?>
        <?php }?>
        </div></div>
        </li>
        <li class="zmm3" style="position: relative;">
            <div class="d1 color99">课程难度:</div>
            <div class="d2"><div>
            <?php if($source){?>
                <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('rank'=>0)]); ?>"
                <?php if($keyword['rank']=='0' || empty($keyword['rank'])){
                                echo "class='aH'";
                                } ?>>全部</a>
                <?php foreach($rank as $k=>$v){?>

                    <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('rank'=>$v['rank_id'])])?>"
                    <?php if($keyword['rank']==$v['rank_id']){
                                echo "class='aH'";
                                } ?>>
                    <?= Html::encode($v->rank_name) ?></a>
                <?php }?>
            <?php }?>
            </div></div>
        </li>
        <li class="zmm3" style="position: relative;">
            <div class="d1 color99">课程难度:</div>
            <div class="d2"><div>
            <?php if($source){?>
                    <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('cate'=>0)]); ?>"
                    <?php if($keyword['cate']=='0' || empty($keyword['cate'])){
                                    echo "class='aH'";
                                    } ?>>全部</a>
                    <?php foreach($cate as $k=>$v){?>

                        <a href="<?php echo \Yii::$app->urlManager->createUrl(['course/index',$keyword,array('cate'=>$v['cate_id'])])?>"
                        <?php if($keyword['cate']==$v['cate_id']){
                                    echo "class='aH'";
                                    } ?>>
                            <?= Html::encode($v->cate_name) ?>
                        </a>
                    <?php }?>
            <?php }?>
            </div></div>
            </li>
            </ul>
    </div>

      	<ul class="zy_course_list">
        <?php foreach ($course as $k => $v) { ?>
            <li>
                <a <?php if(!$user_id){echo 'onclick="login_popup()" '."href='javascript:void(0)'";}else{ ?> href='http://www.bwphp.com/index.php/course/course-detail?course_id=<?php echo  $v['course_id']; ?>' <?php } ?>>
                    <p>
                        <?php if(!empty($v['course_thumb'])) { ?>
                            <a <?php if(!$user_id){echo 'onclick="login_popup()" '."href='javascript:void(0)'";}else{ ?> href='http://www.bwphp.com/index.php/course/course-detail?course_id=<?php echo  $v['course_id']; ?>' <?php } ?>><img alt="<?php echo $v['course_name'] ?>" src="<?php echo 'http://files.bwphp.com/file/image/show/275/175?path='.$v['course_thumb'] ?>"/></a>
                        <?php }else{ ?>
                            <a <?php if(!$user_id){echo 'onclick="login_popup()" '."href='javascript:void(0)'";}else{ ?> href='http://www.bwphp.com/index.php/course/course-detail?course_id=<?php echo  $v['course_id']; ?>' <?php } ?>><img  alt="<?php echo $v['course_name'] ?>" src="http://admin.bwphp.com/css/course/coursePicture" /></a>
                        <?php }?>
                    </p>
                    <div class="">
                        <p class="font14"><?php echo $v['course_name'] ?></p><p class="color99"><?php echo $v['apply_num'] ?>人正在学习</p>
                    </div>
                </a>
            </li>
        <?php } ?>
        </ul>
        <div style="" class="zypage yahei marginB38">
            <div class="zypage_div" style="-moz-user-select: none;">
                <!-- <a class="jp-current" href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=1">1</a>
                <a href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=2">2</a>
                <a href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=3">3</a>
                <a href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=4">4</a>
                <a href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=5">5</a>
                <a><span>...</span></a>
                <a href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=27">27</a>
                <a class="jp-next" href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=2"></a><a href="http://www.bwphp.com/course/list/?catagory=all&amp;career=all&amp;sort_by=&amp;page=27" class="jp-last"></a>
                </div>
                <div class="feom_gong">
                共<span id="page-pane2">27</span>页，
                <input type="hidden">第<input class="zypageTxt" id="page_turning" name="page" onafterpaste="this.value=this.value.replace(/\D/g,'')" onkeyup="this.value=this.value.replace(/\D/g,'')" type="text">页 <input onclick="page_turning()" value="跳转" class="zypageBtn" type="button">
                -->
                <?php echo LinkPager::widget([
                    'pagination' => $pagination,
                    'prevPageLabel'=>'上一页',
                    'nextPageLabel'=>'下一页',
                ]);?>

                </div>
        </div>



    </div>

    </div>